<style>
    .setimg {
        margin: -2px 5px 0 0
    }

    a:hover {
        cursor: pointer;
    }

    .color_red {
        color: red;
    }

    .color_purple {
        color: purple;
    }

    .color_orange {
        color: orange;
    }

    #addform .file {
        position: relative;
    }

    #addform .file span {
        position: absolute;
        right: 80px;
        top: 15px;
        background-color: #414959;
        padding: 2px 6px;
        height: 23px;
        line-height: 23px;
        cursor: pointer;
        color: #fff;
        font-size: 14px;
        overflow: hidden;
        background-image: linear-gradient(to bottom, #6c7994, #414959);
        border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
        border: 1px solid #363d4a;
        display: inline-block;
        *display: inline;
        *zoom: 1;
    }

    #addform .file span input {
        position: absolute;
        font-size: 100px;
        left: 0;
        top: 0;
        opacity: 0;
        filter: alpha(opacity=0);
        cursor: pointer;
    }
</style>
<div class="row-fluid">
    <a style="border:1px solid #ccc" class="block-heading" data-toggle="collapse">列表数据</a>
    <div class="well">
        <a href="/excel/getDataByMonth?warehouse=<?=I('get.warehouse')?>&type=<?=I('get.type')?>&year=<?=I('get.year')?>&month=<?=I('get.month')?>"><button class="btn btn-primary" style="position:relative;float:right;padding:4px 6px;margin-right:40px;margin-top: 10px;">导出报表</button></a>

        <div class="btn-toolbar">
            <form>
                <select name="warehouse" class="warehouse" style="width:100px;">
                    <option value="">仓库/全部</option>
                    <foreach name="warehouse" item="vo" key="ke">
                        <option value="<?=$vo['warehouse_id']?>" <?=$vo['warehouse_id'] == I('get.warehouse')? 'selected': ''?>><?=$vo['warehouse_name']?></option>
                    </foreach>
                </select>

                <select name="type" class="type" style="width:100px;margin-left: 5px;">
                    <option value="">物品/全部</option>
                    <foreach name="kinds" item="vo2" key="ke2">
                        <option value="<?=$vo2?>" <?=$vo2 == I('get.type')? 'selected': ''?>><?=$vo2?></option>
                    </foreach>
                </select>

                <select name="year" class="year" style="width:70px;margin-left: 5px;">
                    <option value="2017" <?=(!I('get.year') && $nowYear == '2017')?'selected':''?> <?=I('get.year') == '2017'?'selected':''?>>2017</option>
                    <option value="2018" <?=(!I('get.year') && $nowYear == '2018')?'selected':''?> <?=I('get.year') == '2018'?'selected':''?>>2018</option>
                    <option value="2019" <?=(!I('get.year') && $nowYear == '2019')?'selected':''?> <?=I('get.year') == '2019'?'selected':''?>>2019</option>
                </select>

                <select name="month" class="month" style="width:70px;margin-left: 5px;">
                    <option value="1" <?=(!I('get.month') && $nowMonth == '1')?'selected':''?> <?=I('get.month') == '1'?'selected':''?>>1月</option>
                    <option value="2" <?=(!I('get.month') && $nowMonth == '2')?'selected':''?> <?=I('get.month') == '2'?'selected':''?>>2月</option>
                    <option value="3" <?=(!I('get.month') && $nowMonth == '3')?'selected':''?> <?=I('get.month') == '3'?'selected':''?>>3月</option>
                    <option value="4" <?=(!I('get.month') && $nowMonth == '4')?'selected':''?> <?=I('get.month') == '4'?'selected':''?>>4月</option>
                    <option value="5" <?=(!I('get.month') && $nowMonth == '5')?'selected':''?> <?=I('get.month') == '5'?'selected':''?>>5月</option>
                    <option value="6" <?=(!I('get.month') && $nowMonth == '6')?'selected':''?> <?=I('get.month') == '6'?'selected':''?>>6月</option>
                    <option value="7" <?=(!I('get.month') && $nowMonth == '7')?'selected':''?> <?=I('get.month') == '7'?'selected':''?>>7月</option>
                    <option value="8" <?=(!I('get.month') && $nowMonth == '8')?'selected':''?> <?=I('get.month') == '8'?'selected':''?>>8月</option>
                    <option value="9" <?=(!I('get.month') && $nowMonth == '9')?'selected':''?> <?=I('get.month') == '9'?'selected':''?>>9月</option>
                    <option value="10" <?=(!I('get.month') && $nowMonth == '10')?'selected':''?> <?=I('get.month') == '10'?'selected':''?>>10月</option>
                    <option value="11" <?=(!I('get.month') && $nowMonth == '11')?'selected':''?> <?=I('get.month') == '11'?'selected':''?>>11月</option>
                    <option value="12" <?=(!I('get.month') && $nowMonth == '12')?'selected':''?> <?=I('get.month') == '12'?'selected':''?>>12月</option>
                </select>
                <input type="hidden" value="<?=I('get.res')?>" name="res"/>
                <button class="btn btn-info" style="margin:-9px 0 0 15px"><i class="icon-search"></i> 查询</button>
            </form>
        </div>

        <hr>
        <table class="table">
            <thead>
            <tr>
                <th style="text-align:center;width:170px">序号</th>
                <th style="text-align:center;width:170px">药品编号</th>
                <th style="text-align:center;width:170px">种类</th>
                <th style="text-align:center;width:170px">名称</th>
                <th style="text-align:center;width:170px">规格型号</th>
                <th style="text-align:center;width:170px">单位</th>
                <th style="text-align:center;width:170px">本月入库量</th>
                <th style="text-align:center;width:170px">本月实际用量</th>
                <th style="text-align:center;width:170px">当前库存余量</th>
                <th style="text-align:center;width:170px">所属仓库</th>
                <th style="text-align:center;width:140px">备注</th>
            </tr>
            </thead>
            <tbody>
            <?php if($getData){foreach($getData AS $key=>$val){ ?>
            <tr>
                <td style="text-align:center;vertical-align:middle;"><?=$key+1?></td>
                <td style="text-align:center;vertical-align:middle;"><?=$val['drug_no']?></td>
                <td style="text-align:center;vertical-align:middle;"><?=$val['type']?></td>
                <td style="text-align:center;vertical-align:middle;"><?=$val['drug_name']?></td>
                <td style="text-align:center;vertical-align:middle;"><?=$val['drug_size']?></td>
                <td style="text-align:center;vertical-align:middle;"><?=$val['drug_unit']?></td>
                <td style="text-align:center;vertical-align:middle;"><?=$val['month_in_num']?></td>
                <td style="text-align:center;vertical-align:middle;"><?=$val['month_use_num']?></td>
                <td style="text-align:center;vertical-align:middle;"><?=$val['stock_num']?></td>
                <td style="text-align:center;vertical-align:middle;"><?=$val['warehouse']?></td>
                <td style="text-align:center;vertical-align:middle;">
                    <a class="ifrm btn" href="javascript:void(0)" data-url="/drug/addMonthListRemark" style="padding: 0px 4px;" data-width="650" data-height="360" data-title="添加备注" data-params="id/<?=$val['id']?>">添加备注</a>&nbsp;&nbsp;
                </td>
            </tr>
            <?php }}else{?>
            <tr>
                <td style="text-align:center" colspan=11>暂无数据</td>
            </tr>
            <?php }?>
            </tbody>
        </table>
        <span style="float:right;margin-top:-44px"><?=$page?></span>
    </div>
</div>
<script>
    $(function () {
        $('.decate').live('click', function () {
            if (!window.confirm('确认删除吗 ?')) {
                return false;
            }
            window.location = $(this).attr('href');
        });
    })
</script>
